package com.yan.demo;

public class MethodDemo2 {
    public static void main(String[] args) {
        int[] arr = {5,12,90,18,77,76,45,28,59,72};
        int[] newArr = newArr(arr);
        for (int i = 0; i < newArr.length; i++) {
            System.out.print(newArr[i] + " ");
        }
    }

    public static int[] newArr(int[] arr){
        int [] arr1 = new int[arr.length-1];
        int index = 2;
        for (int i = 0; i < arr1.length; i++) {
            if(i < index){
                arr1[i] = arr[i];
            } else {
                arr1[i] = arr[i+1];
            }
        }
        return arr1;
    }
}
